package com.zs.blog.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Title: springDocsConfig
 * @Author zs
 * @Package com.zs.blog.config
 * @Date 2024/9/8 16:02
 * @description: SpringDocs配置类
 */
@Configuration
public class SpringDocConfig {

    @Bean
    public OpenAPI SpringOpenAPI() {
        return new OpenAPI().info(new Info().title("zs-blog 接口文档")
                        .contact(new Contact().name("梓少").email("zishao1211@outlook.com"))
                        .description("前后端分离个人博客接口文档")
                        .version("v1.0.0")
                        .license(new License().name("Apache 2.0").url("http://springdoc.org")))
                .externalDocs(new ExternalDocumentation()
                        .description("外部文档")
                        .url("https://springshop.wiki.github.org/docs"));
    }
}
